# Maintainer: Dekedro <dekedro@tankers.xyz>
pkgname=linux-apfs-rw-src
_modname=linux-apfs-rw
pkgver=0.3.5
pkgrel=0
pkgdesc="APFS module for linux, with experimental write support (sources, AKMS)"
url="https://github.com/linux-apfs/linux-apfs-rw"
arch="noarch"
license="GPL-2.0-only"
options="!check" # no tests
source="$_modname-$pkgver.tar.gz::https://github.com/linux-apfs/linux-apfs-rw/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_modname-$pkgver"

prepare() {
	default_prepare

	cat > AKMBUILD <<- EOF
		modname=$_modname
		modver=$pkgver-r$pkgrel
		built_modules='apfs.ko'
	EOF
}

package() {
	install -Dm644 -t "$pkgdir/usr/src/$_modname-$pkgver" -- *.c *.h \
		Makefile AKMBUILD
	cp -a lzfse "$pkgdir/usr/src/$_modname-$pkgver/"
}

sha512sums="
3f0a038e21c67c16a211810019c5dbed5f03f006e6eae0edbd188beb4225e5430f34a90f82141d50f313aaa3bca202ada345bc38ecd0a39aa67b6001c20d0afa  linux-apfs-rw-0.3.5.tar.gz
"
